#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <iostream>
using namespace std;

int main()
{
	long long ax,ay,bx,by,cx,cy;
	cin >> ax >> ay >> bx >> by >> cx >> cy;
	if((ax==bx&&ax==cx)||(ay==by&&ay==cy))	cout << 1 << endl;
	else if(ax==bx&&(cy>=max(ay,by)||cy<=min(ay,by))) cout << 2 << endl;
	else if(ax==cx&&(by>=max(ay,cy)||by<=min(ay,cy))) cout << 2 << endl;
	else if(bx==cx&&(ay>=max(by,cy)||ay<=min(by,cy))) cout << 2 << endl;
	else if(ay==by&&(cx>=max(ax,bx)||cx<=min(ax,bx))) cout << 2 << endl;
	else if(ay==cy&&(bx>=max(ax,cx)||bx<=min(ax,cx))) cout << 2 << endl;
	else if(by==cy&&(ax>=max(bx,cx)||ax<=min(bx,cx))) cout << 2 << endl;
	else cout << 3 << endl;
	return 0;
}
